package cn.etynit.web.controller;

import cn.etynit.dto.AccountLoginDto;
import cn.etynit.result.JsonResult;
import cn.etynit.service.ILoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录相关类
 */
@RestController
@RequestMapping("/login")
@Api(value = "公共服务接口",description = "此接口是公共服务相关的类")
public class LoginController {

    @Autowired
    private ILoginService loginService;

    /**
     * 员工以及业主登录
     * @param accountLoginDto
     * @return
     */
    @ApiOperation(value = "登录接口",notes = "登录接口",response = JsonResult.class)
    @PostMapping("/account")
    public JsonResult accountLogin(@RequestBody AccountLoginDto accountLoginDto){
        return JsonResult.success(loginService.accountLogin(accountLoginDto));
    }
}
